<%@page import="domain.service.Utils"%>
<%@page import="javax.cache.CacheException"%>
<%@page import="java.util.Collections"%>
<%@page import="javax.cache.CacheManager"%>
<%@page import="javax.cache.Cache"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html;charset=UTF-8" language="java"%>
<%
String ip = (String) request.getAttribute("ip");
String title = (String) request.getAttribute("title");
String description = (String) request.getAttribute("description");
String keywords = (String) request.getAttribute("keyword");

Cache cache=null;

try {
    cache = CacheManager.getInstance().getCacheFactory().createCache(Collections.emptyMap());
} catch (CacheException e) {
   e.printStackTrace();
   
}
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>
</jsp:include>
		<div class="bd al">
			<div class="bdl l">
				<%@ include file='/adv/banner.jsp'%>
				<%
					if(cache!=null&&cache.containsKey("lastPing"))
					{
						ArrayList<String> lastPing = (ArrayList<String>)cache.get("lastPing");
				%>
						<h1 class="tt">Recent site view :</h1>
						<ul class="li">
							<% 
								for(String domainName : lastPing) 
								{
							%>
									<li><a href="/domain/<%=domainName%>" title="<%=domainName%>"><%=Utils.cutString(domainName,20) %></a></li>
							<%
								}
							%>
						</ul>
						<div class="cl"></div>
				<%
					}
				%>
				
				<%@ include file='/element/random_site.jsp'%>
				<jsp:include page="/element/top_site.jsp">
					<jsp:param name="title" value="<%=title %>"/>
				</jsp:include>
				
			</div>
			<div class="bdr r">
				<h2>Your ip : <font><%=ip %></font></h2>
				<%@ include file='/adv/right250.jsp'%>
				<%@ include file='/element/menu_left.jsp'%>
			</div>
			<div class="cl"></div>
		</div>
<%@ include file='/layout/footer.jsp'%>